package net.sxnic.workflow.whimpl;

import net.sxnic.workflow.context.WfContextImpl;
import net.sxnic.workflow.handler.AbstractHandler;
import net.sxnic.workflow.handler.HandlerExt;
import net.sxnic.workflow.handler.WfHandlerException;
import net.sxnic.workflow.utils.HuiqianUtils;
import net.sxnic.workflow.wfentity.WfEntity;

/**
 * 会签处理类
 * 
 * @author 孙宇飞
 * 
 */
public class HuiQianHandler extends AbstractHandler<WfEntity> implements
		HandlerExt<WfEntity> {

	public final static String HUIQIAN_KEY_ID = "huiqian_key_id";

	public final static String HUIQIAN_HTML_KEY_ID = "huiqian_html_key_id";

	public HuiQianHandler(WfContextImpl<WfEntity> context) {
		super(context);
	}

	@Override
	public void editExecute() throws WfHandlerException {
		// 显示会签Html

	}

	@Override
	public void saveExecute() throws WfHandlerException {
		context.getEntity().setHuiqian(
				HuiqianUtils.formatHuiqian(
						(String) context.getPros().get(HUIQIAN_KEY_ID), context
								.getEntity().getHuiqianCate()));
	}

	@Override
	public void viewExecute() throws WfHandlerException {

	}

	@Override
	public void submitExecute() throws WfHandlerException {
		context.getEntity().setHuiqian(
				HuiqianUtils.formatHuiqian(
						(String) context.getPros().get(HUIQIAN_KEY_ID), context
								.getEntity().getHuiqianCate()));
	}
	
	

}
